<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
   {{include './header.html'}}
   <main>
     <div class="container">
       {{if msg}}
         <p>{{msg}}</p>
         {{if msg.includes('密码')}}
            <script>
              setTimeout(() => {
                  location.href='/login'
              }, 1000);
            
            </script>
         {{else}}
            <script>
              setTimeout(() => {
                 location.href='/register'
              }, 1000);
             
            </script>
         {{/if}}
       {{else}}
       <form action='/api/login' method="post">
         <div class="form-group">
           <label for="account">账号：</label>
           <input type="text" class="form-control" id="account" name='account' placeholder="请输入账号">
         </div>
         <div class="form-group">
           <label for="pwd">密码：</label>
           <input type="password" class="form-control" id="pwd" placeholder="Password" name='pwd'>
         </div>

         <button type="submit" class="btn btn-success form-control· ">登录</button>
       </form>
       {{/if}}
     </div>
   </main>
   <!-- $.cookie('key') -->
</body>
</html>